#[doc = "Register `soft_int_set` writer"]
pub struct W(crate::W<SOFT_INT_SET_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<SOFT_INT_SET_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl core::convert::From<crate::W<SOFT_INT_SET_SPEC>> for W {
    fn from(writer: crate::W<SOFT_INT_SET_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Software interrupt set"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SOFT_INT_SET_AW {
    #[doc = "1: An interrupt is generated."]
    SET = 1,
}
impl From<SOFT_INT_SET_AW> for bool {
    #[inline(always)]
    fn from(variant: SOFT_INT_SET_AW) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Fields `soft_int(0-3)_set` writer - Software interrupt set"]
pub struct SOFT_INT_SET_W<'a> {
    w: &'a mut W,
    offset: usize,
}
impl<'a> SOFT_INT_SET_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: SOFT_INT_SET_AW) -> &'a mut W {
        self.bit(variant.into())
    }
    #[doc = "An interrupt is generated."]
    #[inline(always)]
    pub fn set(self) -> &'a mut W {
        self.variant(SOFT_INT_SET_AW::SET)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits =
            (self.w.bits & !(0x01 << self.offset)) | (((value as u32) & 0x01) << self.offset);
        self.w
    }
}
impl W {
    #[doc = "Software interrupt set"]
    #[inline(always)]
    pub unsafe fn soft_int_set(&mut self, n: usize) -> SOFT_INT_SET_W {
        SOFT_INT_SET_W { w: self, offset: n }
    }
    #[doc = "Bit 0 - Software interrupt set"]
    #[inline(always)]
    pub fn soft_int0_set(&mut self) -> SOFT_INT_SET_W {
        SOFT_INT_SET_W { w: self, offset: 0 }
    }
    #[doc = "Bit 1 - Software interrupt set"]
    #[inline(always)]
    pub fn soft_int1_set(&mut self) -> SOFT_INT_SET_W {
        SOFT_INT_SET_W { w: self, offset: 1 }
    }
    #[doc = "Bit 2 - Software interrupt set"]
    #[inline(always)]
    pub fn soft_int2_set(&mut self) -> SOFT_INT_SET_W {
        SOFT_INT_SET_W { w: self, offset: 2 }
    }
    #[doc = "Bit 3 - Software interrupt set"]
    #[inline(always)]
    pub fn soft_int3_set(&mut self) -> SOFT_INT_SET_W {
        SOFT_INT_SET_W { w: self, offset: 3 }
    }
    #[doc = "Writes raw bits to the register."]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "Software interrupt set register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [soft_int_set](index.html) module"]
pub struct SOFT_INT_SET_SPEC;
impl crate::RegisterSpec for SOFT_INT_SET_SPEC {
    type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [soft_int_set::W](W) writer structure"]
impl crate::Writable for SOFT_INT_SET_SPEC {
    type Writer = W;
}
